import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

//Tastatur Input
public class InputHandler implements KeyListener{
	
	public boolean left, right, fire, pause;

	public void keyPressed(KeyEvent e) {
		int key = e.getKeyCode();
		
		if(key == KeyEvent.VK_RIGHT){
			right = true;
		}
		if(key == KeyEvent.VK_LEFT){
			left = true;
		}
		if(key == KeyEvent.VK_SPACE){
				fire = true;
		}
		if(key == KeyEvent.VK_P){
			pause = true;
		}
	}

	public void keyReleased(KeyEvent e) {
		int key = e.getKeyCode();

		if(key == KeyEvent.VK_RIGHT){
			right = false;
		}
		if(key == KeyEvent.VK_LEFT){
			left = false;
		}
		if(key == KeyEvent.VK_SPACE){
			fire = false;
		}
		if(key == KeyEvent.VK_P){
			pause = false;
		}
	}

	public void keyTyped(KeyEvent e) {
	}

}
